Optimal. Leaf size=65 \[ \frac{a \cos (c+d x)}{d}+\frac{a \sec (c+d x)}{d}+\frac{3 b \tan (c+d x)}{2 d}-\frac{b \sin ^2(c+d x) \tan (c+d x)}{2 d}-\frac{3 b x}{2} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.107418, antiderivative size = 65, normalized size of antiderivative = 1., number of steps used = 8, number of rules used = 7, integrand size = 25, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.28, Rules used = {2838, 2590, 14, 2591, 288, 321, 203} \[ \frac{a \cos (c+d x)}{d}+\frac{a \sec (c+d x)}{d}+\frac{3 b \tan (c+d x)}{2 d}-\frac{b \sin ^2(c+d x) \tan (c+d x)}{2 d}-\frac{3 b x}{2} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 2838
Rule 2590
Rule 14
Rule 2591
Rule 288
Rule 321
Rule 203
Rubi steps
\begin{align*} \int \sin (c+d x) (a+b \sin (c+d x)) \tan ^2(c+d x) \, dx &=a \int \sin (c+d x) \tan ^2(c+d x) \, dx+b \int \sin ^2(c+d x) \tan ^2(c+d x) \, dx\\ &=-\frac{a \operatorname{Subst}\left (\int \frac{1-x^2}{x^2} \, dx,x,\cos (c+d x)\right )}{d}+\frac{b \operatorname{Subst}\left (\int \frac{x^4}{\left (1+x^2\right )^2} \, dx,x,\tan (c+d x)\right )}{d}\\ &=-\frac{b \sin ^2(c+d x) \tan (c+d x)}{2 d}-\frac{a \operatorname{Subst}\left (\int \left (-1+\frac{1}{x^2}\right ) \, dx,x,\cos (c+d x)\right )}{d}+\frac{(3 b) \operatorname{Subst}\left (\int \frac{x^2}{1+x^2} \, dx,x,\tan (c+d x)\right )}{2 d}\\ &=\frac{a \cos (c+d x)}{d}+\frac{a \sec (c+d x)}{d}+\frac{3 b \tan (c+d x)}{2 d}-\frac{b \sin ^2(c+d x) \tan (c+d x)}{2 d}-\frac{(3 b) \operatorname{Subst}\left (\int \frac{1}{1+x^2} \, dx,x,\tan (c+d x)\right )}{2 d}\\ &=-\frac{3 b x}{2}+\frac{a \cos (c+d x)}{d}+\frac{a \sec (c+d x)}{d}+\frac{3 b \tan (c+d x)}{2 d}-\frac{b \sin ^2(c+d x) \tan (c+d x)}{2 d}\\ \end{align*}
Mathematica [A] time = 0.185097, size = 63, normalized size = 0.97 \[ \frac{a \cos (c+d x)}{d}+\frac{a \sec (c+d x)}{d}-\frac{3 b (c+d x)}{2 d}+\frac{b \sin (2 (c+d x))}{4 d}+\frac{b \tan (c+d x)}{d} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.04, size = 94, normalized size = 1.5 \begin{align*}{\frac{1}{d} \left ( a \left ({\frac{ \left ( \sin \left ( dx+c \right ) \right ) ^{4}}{\cos \left ( dx+c \right ) }}+ \left ( 2+ \left ( \sin \left ( dx+c \right ) \right ) ^{2} \right ) \cos \left ( dx+c \right ) \right ) +b \left ({\frac{ \left ( \sin \left ( dx+c \right ) \right ) ^{5}}{\cos \left ( dx+c \right ) }}+ \left ( \left ( \sin \left ( dx+c \right ) \right ) ^{3}+{\frac{3\,\sin \left ( dx+c \right ) }{2}} \right ) \cos \left ( dx+c \right ) -{\frac{3\,dx}{2}}-{\frac{3\,c}{2}} \right ) \right ) } \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A] time = 1.4814, size = 84, normalized size = 1.29 \begin{align*} -\frac{{\left (3 \, d x + 3 \, c - \frac{\tan \left (d x + c\right )}{\tan \left (d x + c\right )^{2} + 1} - 2 \, \tan \left (d x + c\right )\right )} b - 2 \, a{\left (\frac{1}{\cos \left (d x + c\right )} + \cos \left (d x + c\right )\right )}}{2 \, d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 2.17512, size = 153, normalized size = 2.35 \begin{align*} -\frac{3 \, b d x \cos \left (d x + c\right ) - 2 \, a \cos \left (d x + c\right )^{2} -{\left (b \cos \left (d x + c\right )^{2} + 2 \, b\right )} \sin \left (d x + c\right ) - 2 \, a}{2 \, d \cos \left (d x + c\right )} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F(-1)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A] time = 1.23264, size = 140, normalized size = 2.15 \begin{align*} -\frac{3 \,{\left (d x + c\right )} b + \frac{4 \,{\left (b \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right ) + a\right )}}{\tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{2} - 1} + \frac{2 \,{\left (b \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{3} - 2 \, a \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{2} - b \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right ) - 2 \, a\right )}}{{\left (\tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{2} + 1\right )}^{2}}}{2 \, d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]